﻿@using Orchard.Azure.MediaServices.Models
@using Orchard.ContentManagement
@using Orchard.MediaLibrary.Models
@using Orchard.Utility.Extensions
@{
    var contentItem = (ContentItem)Model.ContentItem;
    var media = contentItem.As<MediaPart>();
    var video = contentItem.As<CloudVideoPart>();
    var thumbnailAsset = video.ThumbnailAsset;
    var thumbnailUrl = thumbnailAsset != null ? thumbnailAsset.PrivateMainFileUrl : Url.Content("~/Modules/Orchard.Azure.MediaServices/Images/Thumbnail-Placeholder2.png");
}
<style type="text/css">
    .media-thumbnail[data-id="@video.Id"] {
        background-image: url("@Html.Raw(thumbnailUrl)");
        -moz-background-size: cover;
        -o-background-size: cover;
        -webkit-background-size: cover;
        background-size: cover;
        background-position: center center;
    }
</style>
<div class="media-thumbnail media-thumbnail-@contentItem.ContentType.HtmlClassify() mime-type-@media.MimeType.HtmlClassify() video" data-id="@video.Id">
</div>
